// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_SYS_PERIOD
// * CreateDate    : 2014-06-05 18:30:45
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:45
// * LastChanger   : 2014-06-05 18:30:45
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class SysPeriodEntity : EntityBase
    {
        public SysPeriodTable TableSchema
        {
            get
            {
                return SysPeriodTable.Current;
            }
		}
		
		public SysPeriodEntity()
        {

        }
		
		public SysPeriodEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.IsActive = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_ACTIVE"]));
			this.Year = Convert.ToInt32(CommonFunctions.ToObject(dr["YEAR"]));
			this.Month = Convert.ToInt32(CommonFunctions.ToObject(dr["MONTH"]));
			this.Day = Convert.ToInt32(CommonFunctions.ToObject(dr["DAY"]));
			this.Description = Convert.ToString(CommonFunctions.ToObject(dr["DESCRIPTION"]));
			this.CalendarId = Convert.ToString(CommonFunctions.ToObject(dr["CALENDAR_ID"]));
			this.PeriodType = Convert.ToInt32(CommonFunctions.ToObject(dr["PERIOD_TYPE"]));
        }
		
		public SysPeriodEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.IsActive = Convert.ToInt32(CommonFunctions.ToObject(dr["IS_ACTIVE"]));
			this.Year = Convert.ToInt32(CommonFunctions.ToObject(dr["YEAR"]));
			this.Month = Convert.ToInt32(CommonFunctions.ToObject(dr["MONTH"]));
			this.Day = Convert.ToInt32(CommonFunctions.ToObject(dr["DAY"]));
			this.Description = Convert.ToString(CommonFunctions.ToObject(dr["DESCRIPTION"]));
			this.CalendarId = Convert.ToString(CommonFunctions.ToObject(dr["CALENDAR_ID"]));
			this.PeriodType = Convert.ToInt32(CommonFunctions.ToObject(dr["PERIOD_TYPE"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return SysPeriodTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(SysPeriodTable.C_ID)); }
            set { SetData(SysPeriodTable.C_ID, value); }
        }
		
        [DataMember]
        public int IsActive
        {
            get { return Convert.ToInt32(GetData(SysPeriodTable.C_IS_ACTIVE)); }
            set { SetData(SysPeriodTable.C_IS_ACTIVE, value); }
        }
		
        [DataMember]
        public int Year
        {
            get { return Convert.ToInt32(GetData(SysPeriodTable.C_YEAR)); }
            set { SetData(SysPeriodTable.C_YEAR, value); }
        }
		
        [DataMember]
        public int Month
        {
            get { return Convert.ToInt32(GetData(SysPeriodTable.C_MONTH)); }
            set { SetData(SysPeriodTable.C_MONTH, value); }
        }
		
        [DataMember]
        public int Day
        {
            get { return Convert.ToInt32(GetData(SysPeriodTable.C_DAY)); }
            set { SetData(SysPeriodTable.C_DAY, value); }
        }
		
        [DataMember]
        public string Description
        {
            get { return Convert.ToString(GetData(SysPeriodTable.C_DESCRIPTION)); }
            set { SetData(SysPeriodTable.C_DESCRIPTION, value); }
        }
		
        [DataMember]
        public string CalendarId
        {
            get { return Convert.ToString(GetData(SysPeriodTable.C_CALENDAR_ID)); }
            set { SetData(SysPeriodTable.C_CALENDAR_ID, value); }
        }
		
        [DataMember]
        public int PeriodType
        {
            get { return Convert.ToInt32(GetData(SysPeriodTable.C_PERIOD_TYPE)); }
            set { SetData(SysPeriodTable.C_PERIOD_TYPE, value); }
        }
		
		#endregion
	}
	
	
}	

